package com.cpp.server.websocket;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TaskController {

    private final LongRunningService longRunningService;

    public TaskController(LongRunningService longRunningService) {
        this.longRunningService = longRunningService;
    }

    @GetMapping("/start-task")
    public String startTask() {
        longRunningService.runLongTask();
        return "任务已启动，请等待完成...";
    }
}